package com.jp.knowledge.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.jp.knowledge.R;
import com.jp.knowledge.model.ExpData;
import com.jp.knowledge.util.ImageLoadUtil;
import com.jp.knowledge.util.TimeUtil;

import java.util.List;

/**
 * Created by jiayen on 16/11/3.
 *
 * 体验数据adapter
 */

public class TiYanAdapter extends  JPBaseAdpter<ExpData.SpecialDataBean> {
    public TiYanAdapter(Context context, List<ExpData.SpecialDataBean> infos) {
        super(context, infos);
    }

    @Override
    protected int getLayoutId(int position) {
        return R.layout.tiyan_item;
    }

    @Override
    protected void renderData(JPViewHolder holder, ExpData.SpecialDataBean item, int position) {
        ImageView icon = holder.getView(R.id.icon);
        TextView title = holder.getView(R.id.tiltle);
        TextView time = holder.getView(R.id.time);
        title.setText(item.getTitle());
        time.setText(TimeUtil.friendly_time(item.getCreatetime()));
        ImageLoadUtil.loadrund(getContext(),item.getIcon(),icon,0);
    }
}
